﻿@model IEnumerable<sipfe.model.dataAccess.SIPMaeTarifa>
@{   
    int k = 0;
    int j = 0;
    int z = 0;
    int nivel = 0;
    int nivelAux = 0;
    int concepto = 0;
    int conceptoAux = 0;
}
<table class="Reporte1">    
    @foreach (var item in Model)
    {
        z++;
        nivel = Convert.ToInt32(@item.nIdeNivel);        
        if ((nivel !=nivelAux))
        {
            nivelAux = nivel;
            k++;
            j = 0;
        <tr>
            <th>#</th>
            <th>Nivel</th>
            <th>Concepto/Especialidad</th>
            <th colspan="7" style="text-align: center;">@ViewBag.nombreEmpresa</th>
        </tr>
        <tr class="odd1" style="font-weight: bold;">
            <td>@k</td>
            <td>@item.vNivel</td>
            <td>&nbsp;</td>
            <td colspan="7">&nbsp;</td>
        </tr>            
        }
        concepto = Convert.ToInt32(@item.nIdeConcepto);
        if ((concepto != conceptoAux))
        {
            conceptoAux = concepto;
            j++;
            z = 1;
        <tr class="even1" style="font-weight: bold;">
            <td style="text-align: right;" colspan="2">@k.@j]</td>
            <td>@item.vConcepto</td>
            <td colspan="7">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
            <th>Modalidad</th>
            <th>% Cubierto X Beca</th>
            <th>% Cubierto X Credito</th>
            <th>% Cubierto X Otras</th>
            <th>Costo Total (100%)</th>
            <th>Inicio Vigencia</th>
            <th>Fin Vigencia</th>
        </tr>           
        } 
        <tr>
            <td style="text-align: right;" colspan="3">@k.@j.@z]</td>
            <td>@item.vModalidad</td>
            <td>@item.nPorCubXBeca</td>
            <td>@item.nPorCubXCredito</td>
            <td>@item.nPorOtrasFuentes</td>
            <td>@item.nCostoTotal</td>
            <td>@String.Format("{0:dd/MM/yyyy}", item.dFecIniVig)</td>
            <td style="text-align: center;">
                @if (@item.dFecFinVig.ToString().Length <= 0) {               
                    <span id="kk"><a onclick="javascript:cerrarVigenciaTarifa(this,'@item.nIdeTarifa');">Cerrar</a></span>
                }else{
                    @String.Format("{0:dd/MM/yyyy}", item.dFecFinVig);
                }
            </td>
        </tr>
    }
</table>
